
import chardet


b = b'haha'
print("二进制bytes:",b,type(b))



print(chardet.detect(b))

data = '离离原上草，一岁一枯荣'.encode('utf-8')
ret = chardet.detect(data)
print(ret)

s = b.decode('ascii')
print( "字符串:",s,type(s))
